package com.lzw.dao;

import com.lzw.pojo.Cla;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ClassDao {
    //映射关系，写一遍就可以
    @Results(id="claMap",value={
            @Result(id =true,property ="cid",column = "c_id"),
            @Result(property ="cname",column = "c_name"),
            @Result(property ="content",column = "c_content"),
    })
    //根据班级编号查询信息
    @Select("select * from class where c_id=#{cid}")
    Cla getClassById (Integer cid);
    //班级的全查
    //调用映射
    @ResultMap("claMap")
    @Select("select c_id,c_name from class")
    List<Cla> getAllCla();
}
